#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Niklas Hauser
#
# This file is part of the modm project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# -----------------------------------------------------------------------------


def init(module):
    module.name = ":driver:lsm303a"
    module.description = """\
# LSM303DLHC 3-Axis Accelerometer

The LSM303DLHC is a system-in-package featuring a 3D digital linear
acceleration sensor and a 3D digital magnetic sensor.
The sensor has linear acceleration full scales of ±2g/±4g/±8g/±16g and a
magnetic field full scale of ±1.3/±1.9/±2.5/±4.0/±4.7/±5.6/±8.1 gauss.
The LSM303DLHC includes an I2C serial bus interface that supports standard and
fast mode 100 kHz and 400 kHz.

Since the device actually features two I2C devices which are just placed in the same
package, this class only implements the acceleration sensor.
"""

def prepare(module, options):
    module.depends(
        ":architecture:register",
        ":driver:lis3.transport",
        ":math:utils")
    return True

def build(env):
    env.outbasepath = "modm/src/modm/driver/inertial"
    env.copy("lsm303a.hpp")
    env.copy("lsm303a_impl.hpp")
